/**
 * (c)Copyright 2007 SinoCredit Co,Ltd. All Rights Reserved.  
 * ActionUtil.java, 1:07:09 PM 
 * @author Ming.Shi
 * @since Oct 9, 2007
 * @version 1.0
 */
package com.sys.plat.util;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.config.ModuleConfig;
import org.apache.struts.util.MessageResources;

import com.sys.plat.web.core.ActionContext;

public class ActionUtil {
	/**
	 * 读取资源文件
	 * @param key
	 * @return
	 */
	public String loadMessage(String key){
		MessageResources messageResources=getResources(ActionContext.getRequest(),"sys_message");
		return messageResources.getMessage(key);
	}
	
	protected MessageResources getResources(HttpServletRequest request,
	        String key) {
	        // Identify the current module
	        ServletContext context= request.getSession().getServletContext();
//	        ModuleConfig moduleConfig =
//	            ModuleUtils.getInstance().getModuleConfig(request, context);

	        // Return the requested message resources instance
//	        return (MessageResources) context.getAttribute(key
//	            + moduleConfig.getPrefix());
			return null;
	    }

}


